/*
 * asserv.h
 *
 *  Created on: 18 mars 2010
 *      Author: Guigui
 */

#ifndef ASSERV_H_
#define ASSERV_H_

#include "compiler.h"

#define ASSERV_COM_BAUD_RATE	( ( unsigned portLONG ) 19200 )

#define ASSERV_COMM_PRIORITY	( tskIDLE_PRIORITY + 1 )
#define ASSERV_COMM_PERIOD		( ( portTickType ) 10 / portTICK_RATE_MS )

typedef struct {
	S16 X;
	S16 Y;
	S16 theta;
	U8 sens;
} AsservPosition;

void asservCommInit();
U8 asservGetPosition (AsservPosition * retPos);
U8 asservSetPosition (AsservPosition * pos);
U8 asservGotoPosition (AsservPosition * pos, U8 octetConfig);
U8 asservRecalage (U8 axeRecalage);
U32 erreurDistance (AsservPosition p1, AsservPosition p2);
AsservPosition makeAsservPosition (S16 X, S16 Y, S16 theta, U8 sens);

extern unsigned char			vitesseMax;

#endif /* ASSERV_H_ */
